import request from "@/utils/axios/request";

interface Question {
  id?: string;
  content?: string;      // 题目内容
  type?: string;         // 题目类型
  tags?: Array<string>;  // 题目标签
  answer?: string;       // 答案
  title?: string;        // 题目标题
  tagIds?: Array<string>;
}

const getQues = (params: { pageNum?: number; pageSize?: number; name?: string; type?: string; }) => {
  return request.get(`/bank/getQues`, { params })
}

const updateQues = (params: Question) => {
  return request.post(`/bank/updateQues`, params)
}

const delQues = (ids: Array<number>) => {
  return request.post(`/bank/delQues`, ids)
}

const addQues = (params: Question) => {
  return request.post(`/bank/addQues`, params)
}

const quesApi = {
  getQues,
  updateQues,
  delQues,
  addQues
}

export default quesApi
